{% extends 'base.html' %}
{% block body %}
    <div class="page-header">
     <h1>Search: {{ q }}           一共有{{ result|length }}条记录</h1>
    </div>
    <div class="row">
    {% for post in result %}
        <h3 class="text-primary">
                <a href="{{ url_for('blog.show_post',post_id=post.id) }}"></a>
            {{ post.title }}
                <small>{{ moment(post.timestamp).fromNow(refresh=True) }}</small>
            </h3>
            <p>
            {{ post.body|striptags|truncate }}
            <small>
                <a href="{{ url_for('blog.show_post',post_id=post.id) }}">
                    detail
                </a>
            </small>
            </p>
    {% endfor %}
    </div>
    <div class="page-footer">
        {{ render_pagination(pagination) }}
    </div>
{% endblock %}